package com.xzc.java8.A_lambda.lambda2;

import java.util.function.ToIntFunction;

/**
 * 有装箱，拆箱问题，可以用原生类型来替换泛型
 */
public class ToIntFunctionTest {

    public static <T> int getStringLength(String s, ToIntFunction<String> f) {
        return f.applyAsInt(s);
    }

    public static void main(String[] args) {
        System.out.println(getStringLength("123", (String s) -> s.length()));
    }
}
